//
//  EFSJumpManager+activity.m
//  EFSMobile
//
//  Created by Chuan on 11/30/15.
//  Copyright © 2015 Elephants Financial Service. All rights reserved.
//

#import "EFSJumpManager+activity.h"

#import "EFSActivityWebController.h"
#import "ActivityInfo.h"

@implementation EFSJumpManager (activity)

+ (void)jumpactivity:(NSArray *)data
{
    NSDictionary *info = [data firstObject];
    UIViewController *viewController = [data lastObject];
    ActivityInfo *activity = [MTLJSONAdapter modelOfClass:[ActivityInfo class] fromJSONDictionary:info error:NULL];
    if (activity) {
        //@TODO("EFSAnalytics");
//        [YTXAnalytics event:AD_GOTOACTIVITY
//                   withData:@{@"activity":[NSString stringWithFormat:@"%@%@", activity.activityId, activity.title]}];
        EFSActivityWebController *activityController = [EFSActivityWebController new];
        
        [activityController showActivity:activity];
        [viewController.navigationController pushViewController:activityController animated:YES];
//        activityController.webView.scalesPageToFit = YES;
    }
}

@end
